package proj2501.geo_util;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;

public class Gr {
	private Graphics2D g2;
	public Graphics2D getGraphics() { return g2; }
	
	public Gr(Graphics g) {
		g2 = (Graphics2D) g;
	}
	public Gr(Graphics2D g2) {
		this.g2 = g2;
	}
	
	public void drawLine(LineSegmentD2 line) {
		drawLine(line.getV1(), line.getV2());
	}
	
	public void drawLine(VectorD2 v1, VectorD2 v2) {
		Line2D.Double line2d = new Line2D.Double(v1.getX(), v1.getY(), v2.getX(), v2.getY());
		g2.draw(line2d);
	}
	
	public void drawCircle(VectorD2 v1, double radius) {
		Ellipse2D.Double ellipse = new Ellipse2D.Double(v1.getX() - radius, v1.getY() - radius, radius * 2, radius * 2);
		g2.draw(ellipse);
	}
}
